<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="my-div"></div>
   
    <script>
        window.onload = function () {
            const myDiv = document.getElementById("my-div");
            const content  = `&lt;div&gt;&lt;h1&gt;hello word !&lt;/h1&gt;&lt;/div&gt;`;;
            // myDiv.innerHTML = 
            myDiv.textContent = content;
        }
    </script>
</body>
</html>